package com.qf.service;

import com.qf.entity.Goods;
import com.qf.service.impl.GoodsServiceimpl;
import com.qf.vo.GoodsEntity;
import com.qf.vo.GoodsType;
import com.qf.vo.Stock;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 你的名字
 * @Date: 2021/07/08/15:37
 * @Description:
 */
@FeignClient(name = "goods" ,fallback = GoodsServiceimpl.class)
public interface GoodsService  {
    @RequestMapping("goods/list")
    public List<GoodsEntity> list();
    /**
     * 信息
     */
    @RequestMapping("goods/info/{id}")
    public GoodsEntity info(@PathVariable("id") Integer id);

    /**
     * 保存
     */
    @PostMapping("goods/save")
    public GoodsEntity save(GoodsEntity goods);

    /**
     * 修改
     */
    @RequestMapping("goods/update")
    public boolean update(@RequestBody GoodsEntity goods);

    /**
     * 删除
     */
    @RequestMapping("goods/delete")
    public boolean delete(@RequestBody Integer[] ids);

    //商品类别
    @RequestMapping("goodsType/getGoodsTypeList")
    public List<GoodsType> getGoodsTypeList();

    @RequestMapping("goodsType/addGoodsType")
    public boolean  addGoodsType(GoodsType goodsType);
    @RequestMapping("/goodsType/getGoodsTypeByPid/{pid}")
    public List<GoodsType> getGoodsTypeByPid(@PathVariable(value = "pid") Integer pid);
  @RequestMapping("goodsType/delNodes/{id}")
    boolean deleteNode(@PathVariable(value = "id") Integer id);
   @RequestMapping("goodsType/updateNode")
    public boolean updateNode(GoodsType goodsType);
    @RequestMapping("goodsType/moveNodes/{trId}/{tarId}")
    public boolean moveNodes(@PathVariable(value = "trId") Integer trId, @PathVariable(value = "tarId") Integer tarId);

   @RequestMapping("stock/addStock")
    public  boolean addStock( @RequestBody Stock stock1);
 @RequestMapping("goods/saveGoodsAndStock")
    public  Goods saveGoodsAndStock(@RequestBody Goods goods);
}
